package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.base.*;
import com.zmj.sy.mom.srv.aps.bean.vo.shifttype.*;
import com.zmj.sy.mom.srv.aps.service.ShiftTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@Api(tags = "班制管理")
@RestController
@RequestMapping("/shiftType")
public class ShiftTypeController {

    private final ShiftTypeService shiftTypeService;

    @ApiOperation("1.1.1 添加班制")
    @PostMapping("/add")
    public BaseResVo add(@RequestBody ShiftTypeAddReqVo reqVo) {
        shiftTypeService.add(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2 班制列表（分页）")
    @GetMapping("/listOld")
    public BasePageResVo<ShiftTypeListResVo> listOld(ShiftTypeListReqVo reqVo) {
        return shiftTypeService.listOld(reqVo);
    }

    @ApiOperation("1.1.2 班制列表（列表）")
    @GetMapping("/list")
    public BaseListResVo<ShiftTypeListResVo> list(ShiftTypeListReqVo reqVo) {
        return shiftTypeService.list(reqVo);
    }

    @ApiOperation("1.1.3 修改班制")
    @PostMapping("/edit")
    public BaseResVo edit(@RequestBody ShiftTypeEditReqVo reqVo) {
        shiftTypeService.edit(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.4 删除班制")
    @GetMapping("/delete")
    public BaseResVo delete(BaseIdReqVo reqVo) {
        shiftTypeService.delete(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.5 班制下拉框")
    @GetMapping("/select")
    public BaseSelectResVo select() {
        return shiftTypeService.select();
    }


    @ApiOperation("1.1.6 查询班制")
    @GetMapping("/get")
    public ShiftTypeGetResVo get(BaseIdReqVo reqVo) {
        return shiftTypeService.get(reqVo);
    }

}
